
import { getUserInfoByUserDDId } from "../api/index"
import pageStore from '../stores/globalStore'
import create from 'dd-store'
import { getUserInfo } from "../api/index"







create.Page({
  store: pageStore,
  data: {
    userDDId: '',


  },
  onLoad() {



  },
  returnHome() {
    dd.getAuthCode({
      success: function (res) {
        console.log(res)
        let data = {
          code: res.authCode
        }

        getUserInfo(data).then(rs => {
          let roleLevel = rs.data.roleLevel;
          console.log("权限值", roleLevel)

          // 跳转页面
          if (roleLevel == 3) {
            dd.reLaunch({ url: '/pages/usual/index' })
          } else if (roleLevel == 1 || roleLevel == 2) {
            dd.reLaunch({ url: '/pages/manage/indexCopy' })
          } else {
            dd.alert({ content: '请输入合法的用户信息' })
          }
        })
      }
    })

  },



  onReachBottom() {


  },

});
